package com.itheima.demo;

import com.itheima.domain.User;
import com.itheima.uitls.MapperUtil;
import org.apache.ibatis.session.SqlSession;

public class Demo5 {

    public static void main(String[] args) {
        SqlSession session = MapperUtil.getSession();
        User user = session.selectOne("com.itheima.mapper.UserMapper.findById", 4);
        System.out.println(user);
        user.setPwd("888");
        //更新操作
        session.update("com.itheima.mapper.UserMapper.findById",user);

        User user1 = session.selectOne("com.itheima.mapper.UserMapper.findById", 4);
        System.out.println(user1);

        session.close();
    }
}
